<?php

namespace App\Policies;

use App\Admin;
use Illuminate\Auth\Access\HandlesAuthorization;

class AdminPolicy
{
    use HandlesAuthorization;

    public function before($user, $ability)
    {
        if ($user->isSuper()) {
            return true;
        }
    }


    public function view($user, Admin $admin)
    {
        //
    }


    public function create($user)
    {
        return $user->isSuper();
    }


    public function update($user, Admin $admin)
    {
        return $user->id === $admin->id;
    }


    public function delete($user, Admin $admin)
    {
        return $user->isSuper();
    }
}
